package com.chenfan.process.vo;

import com.chenfan.process.enums.ProcessEnums;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author K
 * @date 2021/1/27
 */
@Data
@NoArgsConstructor
public class ApprovalVo {

    @ApiModelProperty("主键ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty("审批ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long approvalId;

    /**
     * 审批模板ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long approvalTemplateId;

    @ApiModelProperty("服务名称")
    private String serviceName;

    @ApiModelProperty("业务参数")
    private String param;

    @ApiModelProperty("审批用户ID")
    private String userId;

    @ApiModelProperty("审批用户名称")
    private String userName;

    @ApiModelProperty("审批状态")
    private Integer status;

    @ApiModelProperty("审批状态值")
    private String statusValue;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long createBy;

    private String createName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    public String getStatusValue() {
        return ProcessEnums.getMessage(status);
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

     /**
     * 更新人id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long updateBy;

    /**
     * 更新人名称
     */
    private String updateName;

    /**
     * 业务id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long businessId;

    /**
     * 业务code
     */
    private String businessCode;

    @ApiModelProperty("业务待办参数")
    private String businessParam;


    /**
     * 是否显示催办
     */
    private Boolean autoNotify;


}
